package com.fit.piris.entities.user.fanpage;

import java.io.Serializable;

import javax.persistence.Embeddable;
import javax.persistence.ManyToOne;

import com.fit.piris.entities.fanpage.FanPage;
import com.fit.piris.entities.user.User;

@Embeddable
public class UserFanPagePk implements Serializable{

	@ManyToOne
	private User user;
	@ManyToOne
	private FanPage fanPage;

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public FanPage getFanPage() {
		return fanPage;
	}

	public void setFanPage(FanPage fanPage) {
		this.fanPage = fanPage;
	}

	public boolean equals(Object o) {
		if (this == o)
			return true;
		if (o == null || getClass() != o.getClass())
			return false;

		UserFanPagePk that = (UserFanPagePk) o;

		if (user != null ? !user.equals(that.user) : that.user != null)
			return false;
		if (fanPage != null ? !fanPage.equals(that.fanPage)
				: that.fanPage != null)
			return false;

		return true;
	}
}
